package com.koron.tool.service;

import com.koron.bean.base.Response;
import com.koron.bean.system.staff.vo.EamUser;
import com.koron.bean.workflow.RedirectQuery;
import com.koron.tool.bean.ToolInspectionBean;
import com.koron.tool.bean.ToolInspectionQuery;
import com.koron.tool.bean.ToolQuery;
import org.koron.ebs.mybatis.SessionFactory;

import java.io.OutputStream;

/**
 * @Author: liaodf
 * @Date: 2021/10/25 17:33
 */
public interface ToolInspectionManagerService {

    /**
     * 查询待检验的工具
     *
     * @param query
     * @return
     */
    Response getInspectionTools(SessionFactory factory, ToolQuery query);

    /**
     * 查询单据列表
     *
     * @param query
     * @return
     */
    Response getInspectionList(SessionFactory factory, ToolInspectionQuery query);

    /**
     * 新增检验单据
     *
     * @param id
     * @return
     */
    Response getInspection(SessionFactory factory, EamUser user, String id);

    /**
     * 保存检验单据
     *
     * @param bean
     * @return
     */
    Response savaInspection(SessionFactory factory, EamUser user, ToolInspectionBean bean,Integer operation);

    /**
     * 修改检验单据
     *
     * @param bean
     * @return
     */
    Response updateInspection(SessionFactory factory, EamUser user, ToolInspectionBean bean);

    /**
     * 流程审批回调
     *
     * @param redirectQuery
     * @return
     */
    Response updateState(SessionFactory factory, RedirectQuery redirectQuery);

    /**
     * 导出PDF
     *
     * @param id
     * @return
     */
    void exportPdf(SessionFactory factory, EamUser user, String id, OutputStream os);

    /**
     * 导出检验合格证
     * @param sessionFactory 会话工厂
     * @param user 登录用户
     * @param id 检验单id
     * @param os 网络输出流
     */
    void exportInspectionQualification(SessionFactory sessionFactory, EamUser user, String id, OutputStream os);
}
